﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TTEngine;

namespace TorchesTombs
{
    public class PoolSprite : MapObjectSprite
    {
        //constructor
        public PoolSprite(MapObject mo, Color color)
            : base(mo)
        {
            _color = color;
            Shape = new RectangleF(-32, -32, _width, _height);
            ClickShape = Shape;
        }

        //render
        public override void Render(Graphics g)
        {
            if (Surface == null)
                return;
            Pen pen = new Pen(Color.FromArgb(64, _color.R, _color.G, _color.B));
            pen.Width = 3;
            Brush brush = new SolidBrush(Color.FromArgb(32, _color.R, _color.G, _color.B));
            int dx = MapObject.X * 64 - Surface.OffsetX;
            int dy = MapObject.Y * 64 - Surface.OffsetY;
            g.FillEllipse(brush, dx, dy, _width, _height);
            g.DrawEllipse(pen, dx, dy, _width, _height);
        }

        //private members
        private int _width = Globals.RandomIntFromTo(54, 68);
        private int _height = Globals.RandomIntFromTo(54, 68);
        private Color _color;
    }
}
